<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Ajax请求文本</title>
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <script src="js/jquery-1.12.4.js"></script>
</head>
<body>
    <div id="showTestMsg">默认显示数据</div>
    <input type="button" id="btn1" value="获取数据">
    <script>
    $(function(){
        $("#btn1").click(function(){
            $.get("test.txt",function(data){
                $("#showTestMsg").html(data);
            },"text");
        });
    });

    
    
    
    </script>
</body>
</html>